<?php
$this->breadcrumbs=array(
	'Shops'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Shops', 'url'=>array('index')),
	array('label'=>'Create Shops', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('shops-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>精品馆管理</h1>

<?php echo CHtml::link('查找','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
	'cnstatus'  => $cnstatus,
	'plats' => $plats ,
)); ?>
</div><!-- search-form -->

<?php echo CHtml::link('添加',array('create')); ?>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'shops-grid',
	'dataProvider'=>$model->search(),
	'columns'=>array(
		'shop_id',
		'shop_name',
		'shop_author',
		'platform_type' ,
		'sumary',
		'img',
array(
		'name'=>'status',
		'type'=>'raw',
		'value'=>array($this, 'showStatus')
),

		array(
			'class'=>'CButtonColumn',
			'template'=>'{category} {view} {update} {delete}',
			'buttons'=>array(
					'category' => array(
							'label'=>'类别',
							//'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/coins.png',
							'url'=>'Yii::app()->createUrl("shopSubcategories/index", array("shop_id"=>$data->shop_id, ))',
					),
			),
			'htmlOptions' => array(
					'style'=>'width:100px',
			),
		),
	),
)); ?>
